<template>
  <div>

    <zh-form ref="formInfo"  :rules="rules" :model="formInfo"  labelAlign="right" >

      <zh-card style="width:100%;float:left">

        <zh-row :span="18">
          <zh-input prop="orgId"   type="select"
                    :defaultFields='{label:"dictValue",value:"dictKey",}' :options="orgList" label="所属区划"
                    v-model="formInfo.orgId"></zh-input>
        </zh-row>
        <zh-row :span="18">
          <zh-input prop="b0402"   type="select"
                     :defaultFields='{label:"dictValue",value:"dictKey",}' :options="dictData.B0402" label="表单名称"
                    v-model="formInfo.b0402"></zh-input>
        </zh-row>
        <zh-row :span="18">
          <zh-input prop="b0402"   type="select"
                    :defaultFields='{label:"dictValue",value:"dictKey",}' :options="dictData.B0404" label="周期类型"
                    v-model="formInfo.b0404"></zh-input>
        </zh-row>
        <zh-row :span="18">
          <zh-input prop="b0403"   type="text" label="维护周期(天/次)"
                    v-model="formInfo.b0403"></zh-input>
        </zh-row>
        <div style="height: 50px">

        </div>
      </zh-card>
    </zh-form>
  </div>
</template>

<script>
import moment from 'moment'
import modal from "ant-design-vue/lib/modal";
import { isEmptyStr } from "@/utils/util";
import {getDisposalManData,formMaintForSave,getOrgList
} from '@/services/system/whdngxlApi'
import {getBatchDict} from "@/services/system/api";
import UnmovableRelics from "@/pages/whdngxl/TasksCheckManage/UnmovableRelics";
export default {
  components:{

  },
  props:{
    listQuery:{
      type:Function,
      default:null
    },
  },
  data() {
    return {
      formInfo:{
        orgId:'',
        b0402:'',
        b0403:'',
        b0404:'',
      },
      rules: {
      },
      disposalManData: [],
      orgList: [],
      dictData: {}
    }
  },

  created() {
    this.$http.post(getOrgList, {}).then((res) => {
      this.orgList = res.result
    })
    this.$http.post(getBatchDict, {dictFields: 'B0402,B0404'}).then((res) => {
      this.dictData = res.result;
    });
  },
  methods: {
    moment,
    initData(row){
      this.formInfo = row
    },
    getData(){
      if(isEmptyStr(this.formInfo.orgId)) {
        modal.warn({title: '温馨提示', content: '所属区划不能为空'})
        return null;
      }
      if(isEmptyStr(this.formInfo.b0402)) {
        modal.warn({title: '温馨提示', content: '表单名称不能为空'})
        return null;
      }
      if(isEmptyStr(this.formInfo.b0403)) {
        modal.warn({title: '温馨提示', content: '维护周期不能为空'})
        return null;
      }
      return this.formInfo;
    },
  }
}
</script>

<style scoped>

</style>